<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
	<h1>
		<a id="aHref" href="https://www.bilibili.com/">bilibili首页</a>
	</h1>
</body>
<script>
	const {shell} = require('electron')
	let aHref = document.getElementById('aHref')
	aHref.onclick = function(e){
		//阻止在主窗口中打开链接
		e.preventDefault()
		//获取a标签的href属性
		let href = aHref.getAttribute('href')
		shell.openExternal(href)
	}
</script>
</html>